60 WDT_A_hold(WDT_A_BASE);
63 GPIO_setAsPeripheralModuleFunctionOutputPin(
66 GPIO_SECONDARY_MODULE_FUNCTION
70 GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0);
85 EComp_initParam
param = {0};
86 param.positiveTerminalInput = ECOMP_INPUT_1;
87 param.negativeTerminalInput = ECOMP_INPUT_DAC;
88 param.outputFilterEnableAndDelayLevel = ECOMP_FILTER_DELAY_OFF;
89 param.invertedOutputPolarity = ECOMP_NORMAL_OUTPUT_POLARITY;
90 EComp_init(ECOMP0_BASE, &
param);
93 EComp_configureDACParam dacParam = {0};
94 dacParam.referenceVoltage = ECOMP_DAC_REFERENCE_VOLTAGE_VREF;
95 dacParam.bufferSource = ECOMP_DAC_BUFFER_SOURCE_DUAL_BUFFER_1;
96 dacParam.firstBufferData = 63;
97 EComp_configureDAC(ECOMP0_BASE, &dacParam);
98 EComp_enableDAC(ECOMP0_BASE);
101 EComp_setInterruptEdgeDirection(ECOMP0_BASE, ECOMP_OUTPUT_INTERRUPT_RISING_EDGE);
104 EComp_clearInterrupt(ECOMP0_BASE, ECOMP_OUTPUT_INTERRUPT_FLAG |
105 ECOMP_INVERTED_POLARITY_INTERRUPT_FLAG);
112 EComp_clearInterrupt(ECOMP0_BASE,
113 ECOMP_OUTPUT_INTERRUPT_FLAG
116 EComp_enableInterrupt(ECOMP0_BASE,
117 ECOMP_OUTPUT_INTERRUPT
121 EComp_enable(ECOMP0_BASE);
124 __bis_SR_register(LPM4_bits + GIE);
135 #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
136 #pragma vector=ECOMP0_VECTOR
138 #elif defined(__GNUC__)
139 __attribute__((interrupt(ECOMP0_VECTOR)))
144 EComp_toggleInterruptEdgeDirection(ECOMP0_BASE);
147 EComp_clearInterrupt(ECOMP0_BASE, ECOMP_OUTPUT_INTERRUPT_FLAG);
150 GPIO_toggleOutputOnPin(
MPU_initThreeSegmentsParam param